home *** CD-ROM | disk | FTP | other *** search
/ PC World Interactive 11 / PC World Interactive 11.iso / share / multimed / MAINACT / DATA1.CAB / Script_Files / framstat.rex < prev    next >
OS/2 REXX Batch file  |  1998-05-04  |  2KB  |  40 lines

  1. /**************************************************************
  2.  *                                                            *
  3.  *                   MainActor Rexx Script                    *
  4.  *                                                            *
  5.  *  Returns information and statistics about the size and     *
  6.  *  timecodes for all frames of the current project           *
  7.  *                                                            *
  8.  *  Last modified: 09/04/97, Written by: Markus Moenig        *
  9.  *                                                            *
  10.  **************************************************************/
  11.  
  12.   IF GetGlobalInfo("LOADEDPROJECTS")= "0" THEN DO     /* Check if there are */
  13.    BEGIN                                              /* any projects loaded */
  14.     say "No project loaded! Trying to load project..."/* No: try to load one */
  15.     rc=LoadProject("")                                /* If succeeded, rc = 0 */
  16.     IF rc <> "0" THEN DO
  17.       say "No project loaded! Exiting ..."            /* Failed, exiting ... */
  18.       exit
  19.     END 
  20.    END
  21.  
  22.   SetInfoText("Printing frame information ...")     /* Set descriptive info text */
  23.  
  24.   frames=GetProjectInfo("FRAMES")
  25.   i=1; totalSize=0; totalTime=0;
  26.   DO WHILE i <= frames                      /* Iterate from 1 to number of frames */
  27.    currentSize=GetFrameInfo(i, "SIZE")
  28.    currentTime=GetFrameInfo(i, "TIMECODE")
  29.    totalSize=totalSize + currentSize        /* Sum up size for statistics */
  30.    totalTime=totalTime + currentTime        /* Sum up time for statistics */
  31.                                             /* Print the frame line */
  32.    say "Frame" i ":: Imagesize:" currentSize ", Timecode:" currentTime "ms"
  33.    i=i+1
  34.   END
  35.  
  36.   SetInfoText("Printing statistics ...")
  37.  
  38.   say ""; say "Statistics:";                /* Print statistics */
  39.   say "* Average image datasize per frame: " totalSize/frames "bytes"
  40.   say "* Average frames per second:" 1000/(totalTime/frames) "fps"